package org.gtiles.components.login.authentication;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.gtiles.components.login.pojo.IResource;

/**
 * 已授权的资源明细对象，包括可访问的资源、角色以及其他用户自定义的
 * @author LiuHG
 * @version 1.0
 */
public class AuthorizedDetails implements Serializable{

	private static final long serialVersionUID = -8415596530139227441L;

	private List<IResource> userResources;
	private List<String> userRoles;
	private Map<String,Object> customDetails = new HashMap<String,Object>();
	
	public List<IResource> getUserResources() {
		return userResources;
	}
	public void setUserResources(List<IResource> userResources) {
		this.userResources = userResources;
	}
	public List<String> getUserRoles() {
		return userRoles;
	}
	public void setUserRoles(List<String> userRoles) {
		this.userRoles = userRoles;
	}

	public void putCustomDetails(String name,String value){
		customDetails.put(name, value);
	}
	
	public void removeCustomDetails(String name){
		customDetails.remove(name);
	}
	
	public void clearCustomDetails(){
		customDetails.clear();
	}
	
}
